<template>
	<view>
		<view>
			<uni-nav-bar shadow left-icon="left" dark title="询价单审核" @clickLeft="back()" />
		<uni-row >
			<uni-col :span="24"><uni-easyinput class="uni-mt-5" suffixIcon="search"  v-model="WorkCheckFrom.sourceId" placeholder="来源单据" @iconClick="iconClick" ></uni-easyinput></uni-col>
		</uni-row>	
		</view>
		
		<view v-for="(item,index) in from" :key="index">
			<uni-card>
				<uni-row><text style="font-weight: 600;">来源单据ID:</text>{{item.sourceId}}</uni-row>
				<uni-row><text style="font-weight: 600;">来源单号:</text>1{{item.sourceNum}}</uni-row>
				<uni-row><text style="font-weight: 600;">单据类型:</text>{{item.orderTypeName}}</uni-row>
				<uni-row><text style="font-weight: 600;">规则ID:</text>{{item.ruleId}}</uni-row>
				<uni-row><text style="font-weight: 600;">状态:</text>{{item.statusName}}</uni-row>
				<uni-row><text style="font-weight: 600;">当前所在阶段:</text>{{item.currentFlow}}</uni-row>
				<uni-row><text style="font-weight: 600;">提交人:</text>{{item.submitName}}</uni-row>
				<uni-row><text style="font-weight: 600;">备注:</text>{{item.remark}}</uni-row>
				<uni-row style="text-align: center;"><button size="mini" type="primary" @click="inquiry_review_detail(from[index])">审核</button></uni-row>
			</uni-card>
		</view>
	</view>
</template>

<script>
	import {WorkCheckDatatable} from "@/api/system/user"
	export default {
		data() {
			return {
				from:null,
				WorkCheckFrom:{
					page: 1,
					rows: 100,
					sourceId:null,
					status: 'ING'
				},
				
			}
		},
		onLoad() {
			this.get()
		},
		methods: {
			iconClick(){
				this.get()
			},
			
			get(){
			 WorkCheckDatatable(this.WorkCheckFrom).then(res=>{
				 this.from =res.rows
			 })	
			},
			back(){
					this.$tab.reLaunch('/pages/work/purchaser/index')
			},
			inquiry_review_detail(e){
				uni.navigateTo({
				       url: '/pages/work/purchaser/inquiry_review_detail',
				       success: (respost) => {
				           // 通过eventChannel向被打开页面传送数据
				           respost.eventChannel.emit('acceptDataFromOpenerPage', {data:e},
						   )}
				     });

			}
		}
	}
</script>

<style>

</style>
